<template>
  <div>
    <ul class="note-list">
      <li class="note-item" v-for="(item2,index) in articleList" :key="index.id">
        <div class="content">
          <a class="article-title" target="_blank" :href="`/#/detail/${item2.id}`">{{item2.title}}</a>
          <p class="abstract">{{item2.content}}</p>
          <div class="meta">
            <span class="iconfont" style="color: #ea6f5a">&#xe6dd; {{item2.score}}</span>
            <a class="nickname" target="_blank">{{item2.nickname}}</a>
            <a target="_blank">
              <i class="iconfont">&#xe660; {{item2.comment}}</i>
            </a>
            <span class="iconfont">&#xe669; {{item2.like}}</span>
          </div>
        </div>
        <a href="" class="content-img">
          <img :src="item2.img_url" alt="">
        </a>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'ArticleList',
  props: {
    articleList: {
      type: Array,
      default: () => []
    }
  },
  data () {
    return {}
  }
}
</script>

<style lang="scss">
  .note-list {
    .note-item {
      padding: 0 0 15px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid #f0f0f0;
      margin: 0 0 15px;

      .content {
        flex: 3;
        .article-title {
          font-size: 18px;
          font-weight: 700;
          &:hover{
            text-decoration: underline;
          }
        }

        .abstract {
          margin: 8px 0;
          font-size: 13px;
          line-height: 24px;
          color: #999;
        }

        .meta {
          span, a {
            font-size: 12px;
            margin-right: 10px;
            color: #b4b4b4;

            &.iconfont {
              font-size: 15px;
            }
          }
        }
      }

      .content-img {
        flex: 1;

        img {
          width: 100%;
        }
      }
    }
  }
</style>
